-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[P4Testgen] Replace absl::btree_map with the P4::flat_map implementation #4713
Conversation
@fruffy I think we can jus grab existing |
Added few tests and did some fixes here and there |
2067229
to
7ba600c
Compare
4099d76
to
9bc74fc
Compare
9bc74fc
to
981f59d
Compare
…ion in P4Tools. Signed-off-by: fruffy <[email protected]>
981f59d
to
b8eb277
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is a sorted map better here than e.g. absl::flat_hash_map
? Do we need it to be sorted?
IIRC the order did matter here. And there are lots of small maps here and there, so we need to reduce the overhead as well. |
We do not have a hashing implementation for symbolic variables either. It is added here but not as efficient as it could be. #4667 |
Yep, we don't need to squeeze all the last percents of performance in all case, I am fine with this using |
The flat map implementation was donated by @asl. It seems a little faster than btree_map.